const mongoose = require('mongoose');

const schema = new mongoose.Schema({
    poster: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
    time: {type: Date, default: Date.now()},
    title: String,
    abstract: {type: String, default: ''},
    content: String,
    like: {type: Number, default: 0},
    share: {type: Number, default: 0},
    comment: [{type: mongoose.Schema.Types.ObjectId, ref: 'Comment'}],
})

module.exports = mongoose.model('Blog', schema);